<html>
<head>
    <title>列表页面</title>
    <script type="text/javascript" src="/static/jquery-3.2.1.js"></script>
    <link rel="stylesheet" href="/static/css/index3.css">
</head>
<body>
<h1>列表页面</h1>
<form action="list" method="post">
    学生姓名: <input type="text" name="name" value="${vo.name?if_exists}">
   出生日期:<input type="date" name="dateone" value="${vo.dateone?if_exists}">至
    <input type="date" name="datetwo" value="${vo.datetwo?if_exists}">
    <input type="submit" value="查询">

</form>
<table border="1">
    <tr>
        <td>学生姓名</td>
        <td>性别</td>
        <td>出生日期</td>
        <td>年龄</td>
        <td>联系电话</td>
        <td>专业</td>
        <td>学费</td>
        <td>住宿费</td>
        <td>报名费</td>
        <td>总计</td>
        <td>操作</td>
    </tr>
    <#list info.list as s>
        <tr>
            <td>${s.name}</td>
            <td>${s.gender}</td>
            <td>${s.birthday}</td>
            <td>${s.age}</td>
            <td>${s.phone}</td>
            <td>${s.majorname}</td>
            <td>${s.fee}</td>
            <td>${s.accommodation}</td>
            <td>${s.applyfee}</td>
            <td>${s.applyfee+s.fee+s.applyfee}</td>
            <td><input type="button" value="修改" onclick="update(${s.id})">
                <input type="button" value="删除" onclick="del(${s.id})">
            </td>
        </tr>
    </#list>

</table>
<script >
    function del(id) {

        if (confirm("确定删除?")){
            $.post("del",{id:id},function (result){
                if (result){
                    alert("删除成功")
                    location.reload();
                }else {
                    alert("删除失败")
                }
            })
        }

    }
</script>
</body>

</html>